<?php
class Pageley_Gateway_Database_Condition_NotSqlDecorator extends Pageley_Gateway_Database_Condition_AbstractSqlDecorator {
	
	public function __construct($decoratedCondition, $query) {
		parent::__construct($decoratedCondition);
		$childCondition = $decoratedCondition->getCondition();
		$decoratedCondition->setCondition($this->decorateCondition($childCondition, $query));
	}
	
	protected function createSql() {
		return "NOT " . $this->getDecoratedCondition()->getCondition()->toSql(); 
	}
}